package co.edu.usbcali.ai.ga;

import org.apache.log4j.Logger;

import com.vsdworld.threads.ITaskListener;
import com.vsdworld.threads.ObservableTask;

public class TaskListener implements ITaskListener{
	
    private static Logger logger=Logger.getLogger(TaskListener.class);

	public TaskListener() {
		super();
	}
	
	@Override
	public void beginTask(String taskName, int ticks) {
		logger.info("Begin task "+ticks);
		//System.out.println("Begin task "+ticks);
	}

	@Override
	public void done() {
		logger.info("Done");
		//System.out.println("Done");
	}
/*
	@Override
	public ITaskListener getSubTaskListener(String subTaskId) throws JMSException {
//		JMSTaskListener jmsTaskListener=new JMSTaskListener(connectionFactory, subTaskId, dest);
		JMSTaskListener jmsTaskListener=new JMSTaskListener(connectionFactory, subTaskId, dest);
		return jmsTaskListener;
	}
*/
	@Override
	public void internalWorked(double work) {
		logger.info("Internal worked "+work);
		//System.out.println("Internal worked "+work);
	}

	@Override
	public void prepareSubTask(ObservableTask task, int unitsToWork) {
		logger.info(task.getName()+" "+unitsToWork);
		//System.out.println(task.getName()+" "+unitsToWork);
	}
	

	@Override
	public void setWorkDoneTextCode(String code, String p_message) {
		logger.info(code+" "+p_message);
		//System.out.println(code+" "+p_message);
	}

	@Override
	public void subTask(String taskName) {
		logger.info(taskName);
		//System.out.println(taskName);
	}

	@Override
	public void worked(int unitsWorked) {
		logger.info("worked"+unitsWorked);
		//System.out.println("worked"+unitsWorked);
	}

}
